ECMP means that there exist multiple routing paths that have an equal cost but different intermediate nodes bound for a same destination Internet Protocol (IP) address or a same destination network segment. Traffic sent to a same destination IP address or a same destination network segment can be sent through different paths to implement network load balancing when a network device supports ECMP. Another normal path takes the place of a failed path to complete forwarding processing when the path fails, thereby implementing redundancy backup of a route.
Referring to FIG. 1, FIG. 1 is a schematic structural diagram of a network including ECMPs. When data packets are forwarded between switch (SW) 1 and SW5, any one of three paths may be used for forwarding. The three paths are respectively: SW1→SW2→SW5, SW1→SW3→SW5, and SW1→SW4→SW5.
Existence of the ECMPs may cause that a path for packets in one direction of a service flow is different from a path for packets in the other direction. For example, in FIG. 1, in one session, packets sent from SW1 to SW5 are routed to SW5 along the path SW1→SW2→SW5, while packets sent from SW5 to SW1 are routed to SW1 along a path SW5→SW3→SW1. This inconsistency in forwarding paths for packets in two directions of a same service flow increases difficulties in network maintenance, fault diagnosis, and deployment of a session detection-based network device (for example, a firewall).